//
//  GTVideoViewController.m
//  iOSApp01
//
//  Created by yxh on 2020/4/27.
//  Copyright © 2020 yxh. All rights reserved.
//

#import "GTVideoViewController.h"

@interface GTVideoViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>

@end

@implementation GTVideoViewController 


- (instancetype) init{
    self = [super init];
    if(self){
        self.tabBarItem.title =@"视频";
        self.view.backgroundColor = [UIColor whiteColor ];
    }
    return self;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    
    UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
    flowLayout.minimumLineSpacing = 10;
    flowLayout.minimumInteritemSpacing = 10;
    flowLayout.itemSize = CGSizeMake((self.view.frame.size.width -10)/2, 300);
    
    
    UICollectionView *collectionV= [[UICollectionView alloc] initWithFrame:self.view.bounds collectionViewLayout:flowLayout];
    
    
    collectionV.backgroundColor = [UIColor whiteColor];
    collectionV.delegate = self;
    collectionV.dataSource = self;
    
    [collectionV registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"CVCell"];
    
    
    [self.view addSubview:collectionV];
}




//设置页面展示个数
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{
    return 20;
}


//设置Cell
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath{
    
    UICollectionViewCell *cell =  [collectionView dequeueReusableCellWithReuseIdentifier:@"CVCell" forIndexPath:indexPath];
    
    cell.backgroundColor = [UIColor redColor];
    
    return cell;
    
}



@end
